package com.budwk.app.sqfwV2.enums.enterpriseWarrantyServe;

import com.budwk.app.sqfwDoc.codeGenerator.excelGenerate.BaseTemplateExcelGenerator;
import com.budwk.app.sqfwV2.generator.enterpriseWarrantyServe.excel.EnterpriseAppealExcelGenerator;
import com.budwk.app.sqfwV2.generator.enterpriseWarrantyServe.excel.EnterpriseWarrantyServeExcelGenerator;
import lombok.Getter;

/**
 * 大营路文件对应枚举
 */
@Getter
public enum EnterpriseWarrantyServeFileEnum {
    ENTERPRISE_APPEAL_BOOK("enterprise_appeal_book", new EnterpriseAppealExcelGenerator(), "【企业诉求化解】台账", "sqfwV2/enterpriseWarrantyServe/enterpriseAppeal.xlsx", "sqfwV2/enterpriseWarrantyServe/template/enterpriseAppeal.xlsx", "xlsx"),
    ENTERPRISE_WARRANTY_SERVE_BOOK("enterprise_warranty_serve_book", new EnterpriseWarrantyServeExcelGenerator(), "【包保服务企业】清单", "sqfwV2/enterpriseWarrantyServe/enterpriseWarrantyServe.xlsx", "sqfwV2/enterpriseWarrantyServe/template/enterpriseWarrantyServe.xlsx", "xlsx"),
    ENTERPRISE_INFO_PDF("enterprise_info_pdf", null, "【企业基本信息登记表】合集", "sqfwV2/enterpriseWarrantyServe/enterpriseInfo.docx", "sqfwV2/enterpriseWarrantyServe/template/enterpriseInfo.docx", "docx");

    private final String code;

    private final BaseTemplateExcelGenerator serve;

    private final String name;

    private final String templatePath;

    private final String emptyTemplatePath;

    private final String suffix;


    EnterpriseWarrantyServeFileEnum(String code, BaseTemplateExcelGenerator serve, String name, String templatePath, String emptyTemplatePath, String suffix) {
        this.code = code;
        this.serve = serve;
        this.name = name;
        this.templatePath = templatePath;
        this.emptyTemplatePath = emptyTemplatePath;
        this.suffix = suffix;

    }

    public static EnterpriseWarrantyServeFileEnum getEnterpriseWarrantyServeFileByCode(String code) {
        for (EnterpriseWarrantyServeFileEnum o : EnterpriseWarrantyServeFileEnum.values()) {
            if (o.getCode().equals(code)) {
                return o;
            }
        }
        return null;
    }

}
